﻿<phone:PhoneApplicationPage 
    x:Class="MyDeeWeibo.PageViews.CommentContent"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True"
    xmlns:data="clr-namespace:MyDeeWeibo"
    Loaded="PhoneApplicationPage_Loaded"
    DataContext="{Binding RelativeSource={RelativeSource Self}}">

    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Name="CommentTemplate">
            <Grid Margin="0,12,8,10" Width="424">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid x:Name="HeadGrid" Margin="0">
                    <StackPanel x:Name="ProfileImg" Orientation="Vertical" d:LayoutOverrides="Height, GridBox" Margin="0,-8,0,8" HorizontalAlignment="Left">
                        <Border x:Name="ProfileBorder" BorderThickness="1" Width="80" Height="80" HorizontalAlignment="Left" VerticalAlignment="Top" BorderBrush="{StaticResource TransparentBrush}">
                            <Canvas Margin="0">
                                <Image x:Name="ProfileImage" Source="{Binding user.profile_img}" Height="72" Width="72" Canvas.Left="2" Canvas.Top="2"/>
                                <Image x:Name="VerifyLogo" Height="20" Width="20" Canvas.Left="60" Canvas.Top="60" Source="/Resources/Images/SinaResource.Verifier.png" Visibility="{Binding user.IsVerified}" Stretch="UniformToFill"/>
                            </Canvas>
                        </Border>
                    </StackPanel>
                    <Grid x:Name="Title" UseLayoutRounding="True" Height="30" VerticalAlignment="Top" Margin="85,0,0,0" Grid.Column="1">
                        <Grid.Background>
                            <LinearGradientBrush EndPoint="0.5,0" MappingMode="RelativeToBoundingBox" StartPoint="0.5,1">
                                <GradientStop Color="{Binding Source={StaticResource AppSettings}, Path=colorSaved}" Offset="0"/>
                                <GradientStop Color="Transparent" Offset="0.1"/>
                            </LinearGradientBrush>
                        </Grid.Background>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock x:Name="UserName" Height="30" Margin="-10,0,0,0" FontSize="20" Text="{Binding user.name}" Padding="10,0" FontWeight="Bold" Foreground="Black" LineHeight="16" />
                        <TextBlock x:Name="CreateTimeBlock" Text="{Binding CreatedAt}" FontSize="20" VerticalAlignment="Bottom" Foreground="{StaticResource GreyBrush}" Height="30" HorizontalAlignment="Right" Grid.Column="1"/>
                    </Grid>
                </Grid>

                <StackPanel x:Name="Content" Grid.Row="1" Margin="4,0,0,0" Orientation="Vertical" d:LayoutOverrides="Height" Grid.ColumnSpan="2" >
                    <TextBlock x:Name="StatusBlock" Text="{Binding text}" TextWrapping="Wrap" FontSize="21.333" Foreground="Black" Margin="0" />
                </StackPanel>

                <Grid x:Name="FooterGrid" Margin="4,12,0,0" Grid.Row="2" Grid.ColumnSpan="2">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <StackPanel x:Name="SourcePanel" Orientation="Horizontal" HorizontalAlignment="Left" d:LayoutOverrides="HorizontalAlignment, GridBox">
                        <Image x:Name="StatusPicHint" Source="/Resources/Images/Status_Pic.png" Visibility="{Binding IsThumbnail}" Margin="0,0,0,-2" Width="30"/>
                        <TextBlock x:Name="SourceBlock"
                        	Text="{Binding Source}" 
                        	d:LayoutOverrides="Width" 
                        	HorizontalAlignment="Left" 
                        	VerticalAlignment="Bottom" 
                        	FontSize="18.667" Foreground="{StaticResource GreyBrush}"/>
                    </StackPanel>
                </Grid>

                <Path x:Name="Separater" Data="M0,80 L448,80" Height="1" Margin="0" Grid.Row="2" Stretch="Fill" UseLayoutRounding="False" VerticalAlignment="Top" HorizontalAlignment="Center" Width="424">
                    <Path.Stroke>
                        <SolidColorBrush Color="White"/>
                    </Path.Stroke>
                </Path>
            </Grid>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Style="{StaticResource BackgroundStyle}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <controls:Pivot x:Name="CommentPivot" Title="{StaticResource AppName}" Foreground="{Binding Source={StaticResource AppSettings}, Path=colorSaved}">
            <!--Pivot1-->
            <controls:PivotItem x:Name="comment" Header="内容" Foreground="Black">
                <Grid Grid.Row="1" Margin="12,0" Height="531">
                    <ListBox x:Name="CommentPanel" Foreground="Black" 
                		Margin="0,1,0,0" Height="530" Width="432"
                		ItemsSource="{Binding CommentShow}" HorizontalAlignment="Right"
                		ItemTemplate="{StaticResource CommentTemplate}"/>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>
        <!--TitlePanel contains the name of the application and page title
		<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
			<TextBlock x:Name="ApplicationTitle" Text="{StaticResource AppName}" Style="{StaticResource PhoneTextNormalStyle}" Foreground="{StaticResource PhoneBackgroundBrush}"/>
			<TextBlock x:Name="PageTitle" Text="Timeline" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" Foreground="{StaticResource PhoneBackgroundBrush}"/>
		</StackPanel>->

		ContentPanel - place additional content here-->

    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBar.MenuItems>
                <!--<shell:ApplicationBarMenuItem x:Name="Delete" IsEnabled="True" Text="删除" />-->
            </shell:ApplicationBar.MenuItems>
            <shell:ApplicationBarIconButton x:Name="replyButton" IconUri="/Resources/Icons/appbar_comment.png" Text="回复" Click="replyButton_Click"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>
